<template>
  <el-input
    v-if="isMutable"
    v-bind="formItem.props"
    v-model="modelRef[formItem.key]"
  />
  <span v-else>{{ modelRef[formItem.key] }}</span>
</template>
<script setup lang="ts">
import { defineProps, PropType, toRefs, computed } from 'vue'
const props = defineProps({
  model: {
    type: Object as PropType<any>,
    default: () => ({})
  },
  formItem: {
    type: Object as PropType<any>,
    default: () => ({})
  }
})
const { model } = toRefs(props)
// 将 modelRef 声明为 any 类型
const modelRef: any = model
const isMutable = computed(() =>
  props.formItem.mutable === undefined ? true : props.formItem.mutable
)
</script>
